﻿


-- 查询在场人员详细
CREATE procedure [dbo].[GetCurrentInDataDetails]
as
select kqlsh,aa.sfzh,xm,qybmm,kh,kbs,sj,sfff,case sfff when 0 then '正常' else '非法' end zczt from Kqjl_Info
inner join
(
select sfzh,max(kqsj) sj from Kqjl_Info_Copy
where sfzh<>'0000000000000'
group by sfzh
) aa
on(Kqjl_Info.sfzh=aa.sfzh and kqsj=sj)
where jczt=1